package me.ratel.demo.wechat.config;

/**
 * @author Administrator
 * @time 2016/9/17 13:46
 */
public class ConfigurationImpl implements Configuration {
    private static volatile Configuration configuration;

    private ConfigurationImpl() {
    }

    public static Configuration getConfiguration() {
        if (configuration == null) {
            synchronized (ConfigurationImpl.class) {
                if (configuration == null) {
                    configuration = new ConfigurationWithHardCode();
                }
            }
        }
        return configuration;
    }

    @Override public Integer getRefreshAccessTokenTimes() {
        return configuration.getRefreshAccessTokenTimes();
    }

    @Override public Integer getRefreshAccessTokenInterval() {
        return configuration.getRefreshAccessTokenInterval();
    }

    @Override public String getTokenURL() {
        return configuration.getTokenURL();
    }

    @Override public String getMenuURL() {
        return configuration.getMenuURL();
    }

    @Override public String getUnifiedOrderURL() {
        return configuration.getUnifiedOrderURL();
    }

    @Override public String getOrderQueryURL() {
        return configuration.getOrderQueryURL();
    }

    @Override public String getUnifiedOrderNotifyURL() {
        return configuration.getUnifiedOrderNotifyURL();
    }

    @Override public String getOauth2AuthorizeURL() {
        return configuration.getOauth2AuthorizeURL();
    }

    @Override public String getSnsOAuth2AccessTokenURL() {
        return configuration.getSnsOAuth2AccessTokenURL();
    }

    @Override public String getSnsOAuth2RefreshTokenURL() {
        return configuration.getSnsOAuth2RefreshTokenURL();
    }
}
